<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chic Core 测试</title>
</head>
<body>
    <h1>Chic Core 测试页面</h1>
    <div id="output"></div>

    <script src="./dist/index.umd.js?v=3"></script>
    <script>
        console.log('开始测试 ChicCore...');
        
        if (typeof ChicCore === 'undefined') {
            document.getElementById('output').innerHTML = '<p style="color: red;">❌ ChicCore 未加载</p>';
        } else {
            console.log('ChicCore 对象:', ChicCore);
            console.log('ChicCore 键:', Object.keys(ChicCore));
            
            try {
                // 测试 formatDate 函数
                const result = ChicCore.formatDate(new Date(), 'YYYY-MM-DD HH:mm:ss');
                console.log('formatDate 测试结果:', result);
                
                document.getElementById('output').innerHTML = `
                    <p style="color: green;">✅ ChicCore 加载成功</p>
                    <p>formatDate 测试结果: ${result}</p>
                    <p>可用函数数量: ${Object.keys(ChicCore).length}</p>
                `;
            } catch (error) {
                console.error('测试失败:', error);
                document.getElementById('output').innerHTML = `
                    <p style="color: red;">❌ 测试失败: ${error.message}</p>
                `;
            }
        }
    </script>
</body>
</html>
